package basicJava.generics.generics3;

import basicJava.generics.generics2.Generator;

public class BasicGeneratorDemo {
	public static void main(String[] args){
		//java泛型要求传入Class对象，以便也可以在create（）中用它进行类型推断
		Generator<CountedObject> gen = BasicGenerator.create(CountedObject.class);
		
		for (int i = 0; i < 5; i++) {
			System.out.println(gen.next());
		}
	}
}
